Someone said this could be a ll1 dot grammar but it has to be verified

The good feature of a ll1 grammar is that it is easy to write
a manual parser and / or simpler parser generator can be used.

https://github.com/timtadh/dot#a-ll1-grammar

A LL(1) Grammar

A grammar suitable for top down (recursive descent parsing).

This should be LL(1) but I haven't taken the time to prove it. Use with caution.

Graphs : Graph Graphs
       | Graph
       ;

Graph : GraphStmt
      | COMMENT
      ;

GraphStmt : GraphStart GraphBody
          ;

GraphStart : GraphType
           | GraphType ID
           | STRICT GraphType
           | STRICT GraphType ID
           ;

GraphType : GRAPH
          | DIGRAPH
          ;

GraphBody : LCURLY Stmts RCURLY
          | LCURLY RCURLY
          ;

Stmts : Stmt Stmts
      | e
      ;

Stmt : Stmt' SEMI
     | Stmt'
     ;

// The first two non-terminals are actually redundant. However, they solve
// grammatical ambiguity with respect to edges, nodes, attrs and subgraphs. By
// using them you will not need arbitrary look-ahead
Stmt' : StmtIDStart // matches things starting with ID
      | StmtSubGraphStart // matches things starting with Subgraph
      | EdgeStmt
      | AttrStmt
      | NodeStmt
      | SubGraph
      | COMMENT
      ;

StmtIDStart : ID AttrStmtCont
            | ID NodeIdCont
            ;

AttrStmtCont : EQUAL ID
             ;

NodeIdCont : Port EdgeCont
           | Port AttrLists
           | EdgeCont
           | AttrLists
           ;

StmtSubGraphStart : SubGraph EdgeCont
                  | SubGraph
                  ;

EdgeStmt : EdgeReciever EdgeCont
         ;

EdgeCont : EdgeRHS AttrList
         ;

EdgeReciever : NodeId
             | SubGraph
             ;


AttrStmt : AttrType AttrLists
         | ID EQUAL ID
         ;

NodeStmt : NodeId AttrLists
         ;

SubGraph : SubGraphStart GraphBody;

NodeId : ID
       | ID Port
       ;

Port : COLON ID
     | COLON ID COLON ID // where second ID in "n", "ne",
                         // "e", "se", "s", "sw", "w", "nw",
                         // "c", "_"
     ;


AttrType : NODE
         | EDGE
         | GRAPH
         ;

AttrLists : AttrList AttrLists
          | e
          ;

AttrList : LSQUARE AttrExprs RSQUARE
         ;

AttrExprs : AttrExpr AttrExprs
          | e
          ;

AttrExpr : ID EQUAL ID
         | ID EQUAL ID COMMA
         | ID EQUAL ID SEMI
         ;



EdgeRHS : EdgeOp EdgeReciever EdgeRHS'
        ;

EdgeRHS' : EdgeOp EdgeReciever EdgeRHS'
         | e
         ;

EdgeOp : ARROW         // only valid for digraph
       | DDASH         // only valid for graph
       ;



SubGraphStart : SUBGRAPH GraphBody
              | SUBGRAPH ID GraphBody
              | e
              ;

The Token Types

NODE = "node"
EDGE = "edge"
GRAPH = "graph"
DIGRAPH = "digraph"
SUBGRAPH = "subgraph"
STRICT = "strict"
LSQUARE = "["
RSQUARE = "]"
LCURLY = "{"
RCURLY = "}"
EQUAL = "="
COMMA = ","
SEMI = ";"
COLON = ":"
ARROW = "->"
DDASH = "--"
ID = ([a-zA-Z_][a-zA-Z0-9_]*)|("([^\"]|(\\.))*")|ID-HTML
COMMENT = (/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)|(//.*$)

Note: The ID token is has 3 forms:

    The usual form as a name [a-zA-Z_][a-zA-Z0-9_]*

    A string, "([^\"]|(\\.))*". Thus "\\\"" is valid but "\\"" is not

    A HTML string, which is non-regular:

     CHAR = [^<>]
     ID-HTML = IdHTML

     IdHTML : Tag ;
     Tag : < Body > ;
     Body : CHAR Body ;
          | Tag Body
          | e                    // denotes epsilon, the empty string
          ;

    Thus <<xyz<xy>xyz><asdf>> is valid but <<> is not

Also dot allows fp numbers when int numbers are expected and there
many more of this kind of details which make parsing difficult

for the record and html labels are additional parsers needed
which are not complex but also have details needing extra checks

Als dot does not warn about syntax details which are possibly
not correct on the input and it has details which cannot parsed
accurate because it can be interpreted diffently

Also dot does have hardcoded undocumented limits in the parser code.


